$('.layui-form').submit(function (e) {
  e.preventDefault() 
  var fd = $(this).serialize();
  console.log(fd);
  $.ajax( {
    type:'post',
    url:'/api/login',
    data:fd,
    success: function (res) {
      if (res.status ===0) {
        console.log(res);
        localStorage.setItem('token',res.token)
        location.href = './index.html'
      } else {
        layer.msg(res.message)
      }
    }
  })
})